Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

614
Visualizações
Getting "Did you mean to run dotnet SDK commands? Please install dotnet SDK from"

I am trying to containerize a .net MVC application, but when I run the image am getting the error like below

user@tuser:~/sam/WebApp$ docker run -p 8000:80 sam:latest

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

user@user:~/sam/WebApp$

And my Dockerfile looks like

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY /bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApp.dll"]

Where am I going wrong?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Late answer, but pretty common issue so I'll answer it.

This usually happens if the dll targeting argument in your entrypoint doesn't exist. There are other possibilities if you're exporting, tar-ing and reimporting assets, but that's probably not what we're dealing with here.

In your case, the copy operation is pointing at a root relative file location. I assume that you're not publishing to {system root/}bin/Release/Publish, and your dockerfile is located in the root of your project.

To solve this, you should perform copy operations relative to the directory your dockerfile is in, and specify copy operations using a directory relative path (./etc).

Example that works from my testing:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY ./bin/Release/Publish /app
ENTRYPOINT ["dotnet", "WebApi.dll"]

To see if it works, examine the resulting container by launching with a cmd override:

docker run -it --rm sam:latest /bin/sh
...
pwd #ensure workdir is app
ls -la #ensure that your application is copied here

If you want to investigate deeper, you can use docker run to override your entrypoint and experiment with different launch configurations to see the output. The commands you'll need are as follows:

docker run -it --rm --entrypoint {dotnet executable} {image}:{tag} {non-existent dll}

Example of output when targeting a non-existent dll via override on an otherwise working container:

➜ docker run -it --rm --entrypoint dotnet sam:latest weebles.dll
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
  https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda